USE [BMIG_MENSUAL_POST_CADENA]

 -- creating the store procedure
IF EXISTS (SELECT name 
	   FROM   sysobjects 
	   WHERE  name = 'WASP_M0010_TELEFONO'
	   AND 	  type = 'P') 
	DROP PROCEDURE WASP_M0010_TELEFONO
GO

CREATE PROCEDURE [dbo].[WASP_M0010_TELEFONO] AS
begin 
    SELECT 
    	ctnro, 
    	max (dotelf) tel1
    INTO 	dbo.ingreso_produccion_numero_telefono
    FROM  FSR006  (nolock)
    group by ctnro
END    	 
